<?php 
include("conn.php");
include('seguridad.php');
$pkuser='01';
$pro=$_POST['deta'];
print "<script>alert('Se i.$pro.o');</script>";
/*$query ="delete from bt14situes where bt14ides='".$pkuser."'";
echo 'eliminado '.$mysqli->query($query);*/
foreach ($_REQUEST["seleccion"] as $value) {
if($value!='8'){
$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`)
													VALUES ('$value',
													        '$pkuser','checked');";
}
else{	
	$query = "INSERT INTO `bt14situes`(`bt14cosi`,`bt14ides`,`bt14esta`,`bt14deta`)
													VALUES ('$value',
													        '$pkuser','checked','$pro');";	
}
echo $mysqli->query($query);
}
print "<script>alert('Se inserto con exito');</script>";
print "<script>window.open('../Usuarios/index.php', '_self');</script>";
header('Location: GestionCondiciones3.php'); 
?>
